/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.order.api.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 订单管理
 *
 * @author pigx code generator
 * @date 2023-12-06 22:47:34
 */
@Data
@TableName("order_info")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "订单管理")
public class OrderInfo extends Model<OrderInfo> {

	private static final long serialVersionUID = 1L;

	/**
	 * 订单号
	 */
	@TableId(type = IdType.ASSIGN_ID)
	@Schema(description = "订单号")
	private Long id;

	/**
	 * 推广渠道编号
	 */
	@Schema(description = "推广渠道编号")
	private String ChannelCode;

	/**
	 * 订单来源
	 */
	@Schema(description = "订单来源")
	private String platform;

	/**
	 * 订单类型 1: 普通订单 2: 预售订单
	 */
	@Schema(description = "订单类型 1: 普通订单 2: 预售订单 3: 权益包")
	private String orderType;

	/**
	 * 订单状态 1: 代付款 2: 待发货 3: 待收货 4: 已完成 5: 退货 6: 已取消
	 */
	@Schema(description = "订单状态 1: 代付款 2: 待发货 3: 待收货 4: 已完成 5: 退货 6: 已取消")
	private String orderStatus;

	/**
	 * 支付方式
	 */
	@Schema(description = "支付方式")
	private String payChannel;

	/**
	 * 用户ID
	 */
	@Schema(description = "用户ID")
	private Long shopUserId;

	/**
	 * 销售员ID
	 */
	@Schema(description = "销售员ID")
	private Long salesShopUserId;

	/**
	 * 父用户ID
	 */
	@Schema(description = "父用户ID")
	private Long parentId;

	/**
	 * 用户昵称
	 */
	@Schema(description = "用户昵称")
	private String nickName;

	/**
	 * 省份
	 */
	@Schema(description = "省份")
	private String province;

	/**
	 * 城市
	 */
	@Schema(description = "城市")
	private String city;

	/**
	 * 区域
	 */
	@Schema(description = "区域")
	private String area;

	/**
	 * 详细地址
	 */
	@Schema(description = "详细地址")
	private String address;

	/**
	 * 联系人
	 */
	@Schema(description = "联系人")
	private String contacts;

	/**
	 * 联系电话
	 */
	@Schema(description = "联系电话")
	private String contactNumber;

	/**
	 * 原订单金额
	 */
	@Schema(description = "原订单金额")
	private Integer sourceOrderPrice;

	/**
	 * 订单金额
	 */
	@Schema(description = "订单金额")
	private Integer orderPrice;

	/**
	 * 优惠金额
	 */
	@Schema(description = "优惠金额")
	private Integer couponPrice;

	/**
	 * 支付金额
	 */
	@Schema(description = "支付金额")
	private Integer payPrice;

	/**
	 * 钱包抵扣
	 */
	@Schema(description = "钱包抵扣")
	private Integer walletPrice;

	/**
	 * 订单取消理由
	 */
	@Schema(description = "订单取消理由")
	private String cancelReason;

	/**
	 * 支付时间
	 */
	@Schema(description = "支付时间")
	private LocalDateTime payTime;

	/**
	 * 发货时间
	 */
	@Schema(description = "发货时间")
	private LocalDateTime sendTime;

	/**
	 * 收货时间
	 */
	@Schema(description = "收货时间")
	private LocalDateTime receiptTime;

	/**
	 * 退款时间
	 */
	@Schema(description = "退款时间")
	private LocalDateTime refundTime;

	/**
	 * 退款原因
	 */
	@Schema(description = "退款原因")
	private String refundReason;

	/**
	 * 退货时间
	 */
	@Schema(description = "退货时间")
	private LocalDateTime returnTime;

	/**
	 * 退货原因
	 */
	@Schema(description = "退货原因")
	private String returnReason;

	/**
	 * 订单评论ID
	 */
	@Schema(description = "订单评论ID")
	private Long orderCommentId;

	/**
	 * 订单评论ID
	 */
	@Schema(description = "获得总积分")
	private Integer totalPoint;

	/**
	 * 获得总一级分润
	 */
	@Schema(description = "获得总一级分润")
	private Integer totalFirstProfit;

	/**
	 * 获得总二级分润
	 */
	@Schema(description = "获得总二级分润")
	private Integer totalSecondProfit;

	/**
	 * 微信支付返回信息
	 */
	@Schema(description = "微信支付返回信息")
	private String wechatPayInfo;

	/**
	 * 优惠券ID
	 */
	@Schema(description = "优惠券ID")
	private String couponIds;

	/**
	 * 备注
	 */
	@Schema(description = "备注")
	private String remark;

	/**
	 * 删除标记
	 */
	@TableLogic
	@Schema(description = "删除标记")
	private String delFlag;

	/**
	 * 创建时间
	 */
	@Schema(description = "创建时间")
	@TableField(fill = FieldFill.INSERT)
	private LocalDateTime createTime;

	/**
	 * 创建人
	 */
	@Schema(description = "创建人")
	@TableField(fill = FieldFill.INSERT)
	private String createBy;

	/**
	 * 修改时间
	 */
	@Schema(description = "修改时间")
	@TableField(fill = FieldFill.UPDATE)
	private LocalDateTime updateTime;

	/**
	 * 更新人
	 */
	@Schema(description = "更新人")
	@TableField(fill = FieldFill.UPDATE)
	private String updateBy;

}
